<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
<table class="table table-hover table-bordered">
    <thead>
    <tr>
        <th class="text-center">ID</th>
        <th class="text-center" th:if="${setCreator}==true">用户昵称</th>
        <th class="text-center">最新观看时间</th>
        <th class="text-center">最新观看来源</th>
        <th class="text-center">观看课程-播放章节</th>
        <th class="text-center">课程类型</th>
        <th class="text-center">章节资源类型</th>
        <th class="text-center">总播放时间</th>
        <th class="text-center">播放次数</th>
        <th class="text-center">操作</th>
    </tr>
    </thead>
    <tbody>
    <tr th:if="${#lists.isEmpty(dataMap['list'])}">
        <td colspan="9">
            <div class="noDataTipsBox">
                <p><span class="c-4e fs16">亲，还没有数据~~~</span></p>
            </div>
        </td>
    </tr>
    <tr th:if="!${#lists.isEmpty(dataMap['list'])}" th:each="playRecord:${dataMap['list']}">
        <td class="text-center" th:text="${playRecord['id']}"></td>
        <td class="text-center" th:if="${setCreator}" >
            <span th:text="${playRecord['user']['nickname']}"></span>
        </td>
        <td class="text-center">
                <span class="line">
                    <i class="fa fa-clock-o"></i>
                    <span th:text="${#strings.substring(playRecord['updateTime'],0,16)}"></span></span>
        </td>
        <td class="text-center">
            <span th:if="${playRecord['source']}== '1'">WEB_PC </span>
            <span th:if="${playRecord['source']}== '2'">H5</span>
            <span th:if="${playRecord['source']}== '3'">IOS</span>
            <span th:if="${playRecord['source']}== '4'">小程序</span>
            <span th:if="${playRecord['source']}== '5'">Android</span>

        </td>
        <th:block th:if="${playRecord['courseCatalog']}!=null">
            <td class="text-center" th:utext="${playRecord['buyCourse']['courseName']}+'<br>'+${playRecord['courseCatalog']['catalogName']}"></td>
        </th:block>
        <th:block th:if="${playRecord['courseCatalog']}==null">
            <td class="text-center" th:text="${playRecord['buyCourse']['courseName']}+'(该章节不存在)'"></td>
        </th:block>
        <td class="text-navy text-center">
            <span th:if="${playRecord['buyCourse']['courseTypeKey']}== 'ARTICLE'">文章</span>
            <span th:if="${playRecord['buyCourse']['courseTypeKey']}== 'COLUMNS'">专栏</span>
            <span th:if="${playRecord['buyCourse']['courseTypeKey']}== 'LIVE'">直播</span>
            <span th:if="${playRecord['buyCourse']['courseTypeKey']}== 'VIDEO'">视频</span>
            <span th:if="${playRecord['buyCourse']['courseTypeKey']}== 'PACKAGE'">套餐</span>
        </td>
        <td class="text-center" th:if="${playRecord['courseCatalog']}==null">
            <span>章节不存在</span>
        </td>
        <td class="text-navy text-center" th:if="${playRecord['courseCatalog']}!=null">
            <span th:if="${playRecord['courseCatalog']['materialTypeKey']}== 'ARTICLE'">文章</span>
            <span th:if="${playRecord['courseCatalog']['materialTypeKey']}== 'LIVE'">直播</span>
            <span th:if="${playRecord['courseCatalog']['materialTypeKey']}== 'VIDEO'">视频</span>
            <span th:if="${playRecord['courseCatalog']['materialTypeKey']}== 'AUDIO'">音频</span>
        </td>
        <td class="text-center" th:text="(${playRecord['durationCatalogNum']}!=null?${#numbers.formatDecimal(playRecord['durationCatalogNum']/60.0,1,2)}:'0')+'分钟'"></td>
        <td class="text-center" th:text="${playRecord['playNumber']}"></td>
        <td class="text-center">
            <a th:if="${playRecord['courseCatalog']}==null" href="javascript:void (0);"  th:text="章节不存在" class="btn btn-sm"  th:classappend="'btn-default'"></a>
            <a th:if="${playRecord['courseCatalog']}!=null" href="javascript:void (0);"  th:attrappend="data-practice=${playRecord['practice']},data-catalog-practice=${playRecord['courseCatalog']['practice']},data-scorePercent=${playRecord['buyCourse']['scorePercent']},data-course-name=${playRecord['buyCourse']['courseName']},data-catalog-name=${playRecord['courseCatalog']['catalogName']}" class="btn btn-sm"  th:classappend="${#strings.isEmpty(playRecord['courseCatalog']['lorePointIds'])}?'btn-default':'btn-primary lookPractice'">随堂练习</a>&nbsp;&nbsp;<a href="javascript:void (0);" th:attr="data-id=${playRecord['buyCourse']['id']},data-name=${playRecord['buyCourse']['courseName']},data-userid=${playRecord['userId']},data-type=${playRecord['buyCourse']['courseTypeKey']}"    class="btn btn-primary btn-sm lookCourse">查看课程</a>
            &nbsp;&nbsp;
            <th:block th:if="${playRecord['courseCatalog']}!=null">
                <a href="javascript:void (0);" th:attr="data-playname=${playRecord['buyCourse']['courseName']}+'-'+${playRecord['courseCatalog']['catalogName']},data-buycourseid=${playRecord['buyCourseId']},data-userid=${playRecord['userId']},data-courseid=${playRecord['courseId']},data-catalogid=${playRecord['catalogId']}"    class="btn btn-primary btn-sm lookCoursePlayDetail">查看明细</a>
            </th:block>
            <th:block th:if="${playRecord['courseCatalog']}==null">
            <a href="javascript:void (0);" th:attr="data-playname=${playRecord['buyCourse']['courseName']}+'(该章节不存在)',data-buycourseid=${playRecord['buyCourseId']},data-userid=${playRecord['userId']},data-courseid=${playRecord['courseId']},data-catalogid=${playRecord['catalogId']}"    class="btn btn-primary btn-sm lookCoursePlayDetail">查看明细</a>
            </th:block>
        </td>
    </tr>
    </tbody>
</table>
<!-- 分页，开始 -->
<div data-th-replace="layout/adminPage"></div>
<!-- 分页，结束 -->